package com.example.demo.api.factory;

import com.demo.sample.common.OperationResponse;
import com.example.demo.api.RemoteAccountService;
import feign.hystrix.FallbackFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class RemoteAccountFallbackFactory implements FallbackFactory<RemoteAccountService> {
    @Override
    public RemoteAccountService create(Throwable throwable) {
        return new RemoteAccountService() {
            @Override
            public OperationResponse debit(Integer userId, BigDecimal money) {
                return null;
            }
        };
    }
}
